{extends 'base/site2.html'}
{block name="page_header"}{include file="common/header.html" inline}{/block}
{block name="page_nav"}{include file="common/slide-nav.html" inline}{/block}
{block name="page_styles"}
<link rel="stylesheet" type="text/css" href="/css/mediation/casecenter/index.css" />
    <style>
        :not(.input-group)>.bootstrap-select.form-control:not([class*=col-]){
            width: 100%;
        }
        .line {
            width: 3px;
            height: 20px;
            background: #1474FA;
            display: block;
            float: left;
            margin-right: 10px;
            margin-left: 10px;
        }
    </style>
{/block}

{block name="page_section"}
<div class="sessionPage">
    <div class="page-header">
        <div class="left">
            <span class="line"></span>
            <strong class="tit">
                操作中心
            </strong>
        </div>
    </div>
    <form class="small-style" method="get" action="" role="validform" enctype="multipart/form-data">
        <div class="form_row">
            <input type="hidden" name="is_show" class="showmoreishow" value="{if $is_show == 1}1{else}0{/if}">
            <input type="hidden" name="limit" value="{if $query.limit}{$query.limit}{/if}">
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">调解部门:</label>
                <div class="col-sm-7">
                    <select class="form-control selectpicker"    title="请选择" name="search[mediationOrganId]" id="mediationOrganId">
                        {foreach from=$mediationOrgan  item=info}
                        <option class="u144_input_option" {if !empty($query.search.mediationOrganId) &&  $info.id== $query.search.mediationOrganId}selected="selected"{/if} value="{$info.id}">{$info.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">资产方:</label>
                <div class="col-sm-7">
                    <select class="form-control selectpicker"   title="请选择" name="search[assetsId]" id="assetsId">
                        {foreach from=$assets  item=info}
                        <option class="u144_input_option" {if !empty($query.search.assetsId) &&  $info.id == $query.search.assetsId}selected="selected"{/if} value="{$info.id}">{$info.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">案件号:</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control noempty col-sm-4" value="{$query.search.id}" name="search[id]" id="id"  placeholder="请输入~">
                </div>
            </div>

            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">当事人:</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control"  name="search[litigantName]" value="{if isset($query.search.litigantName)}{$query.search.litigantName}{/if}" placeholder="当事人姓名">
                </div>
            </div>
        </div>
        <div class="form_row">
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">案件状态:</label>
                <div class="col-sm-7">
                    <select class="form-control" name="search[caseStatus]" role-ele="status" >
                        <option class="u144_input_option" {if $query.search.caseStatus == 0} selected="selected" {/if} value="0" }>全部</option>
                        {if $caseStatusArr}
                        {foreach from=$caseStatusArr key=id item=info}
                        <option class="u144_input_option" value="{$id}"  {if $query.search.caseStatus === $id}selected="selected"{/if}>{$info}</option>
                        {/foreach}
                        {/if}
                    </select>
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">调解状态:</label>
                <div class="col-sm-7">
                    <select class="form-control selectpicker"   title="请选择" name="search[mediateStatus]" id="mediateStatus">
                        {foreach from=$mediateStatus key=key  item=info}
                        <option class="u144_input_option" {if !empty($query.search.mediateStatus) &&  $key == $query.search.mediateStatus}selected="selected"{/if} value="{$key}">{$info}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">还款状态:</label>
                <div class="col-sm-7">
                    <select class="form-control selectpicker"   title="请选择" name="search[repayStatus]" id="repayStatus">
                        {foreach from=$repayStatusArr  key=key item=info}
                        <option class="u144_input_option" {if !empty($query.search.repayStatus) &&  $key == $query.search.repayStatus}selected="selected"{/if} value="{$key}">{$info}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">调解员:</label>
                <div class="col-sm-7">
                    <select class="form-control selectpicker"   title="请选择" name="search[mediatorId]" id="mediatorId">
                        {foreach from=$mediator  item=info}
                        <option class="u144_input_option" {if !empty($query.search.mediatorId) &&  $info.id == $query.search.mediatorId}selected="selected"{/if} value="{$info.id}">{$info.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="start-hide col-lg-12 form_row" data-isshow="{if $is_show == 1}true{else}false{/if}" {if $is_show == 1}style="padding:0px;"{else}style="padding:0px;display:none;"{/if}>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">导入批次:</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control noempty col-sm-4"  value="{if !empty($query.search.importRecordId)}{$query.search.importRecordId}{/if}" name="search[importRecordId]" id="importRecordId" placeholder="请输入~">
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">案件标识号:</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control noempty col-sm-4"  value="{if !empty($query.search.batshId)}{$query.search.batshId}{/if}" name="search[batshId]" id="batshId" placeholder="请输入~">
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">案件合同号:</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control noempty col-sm-4"  value="{if !empty($query.search.contractNo)}{$query.search.contractNo}{/if}" name="search[contractNo]" id="contractNo" placeholder="请输入~">
                </div>
            </div>
            <div class="form-group col-lg-3 ui-select">
                <label for="exampleInputName2"  class="col-sm-4 control-label">案件类型:</label>
                <div class="col-sm-7">
                    <select class="form-control"   title="请选择"  name="search[caseType]" id="caseType">
                        <option class="u144_input_option" value="0">请选择</option>
                        {foreach from=$caseType key=key  item=info}
                        <option class="u144_input_option" {if !empty($query.search.caseType) &&  $key ==  $query.search.caseType }selected="selected"{/if} value="{$key}">{$info}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>

        <div class="start-hide col-lg-12 form_row" data-isshow="{if $is_show == 1}true{else}false{/if}" {if $is_show == 1}style="padding:0px;"{else}style="padding:0px;display:none;"{/if}>
        <div class="form-group col-lg-3 ui-select">
            <label class="col-sm-4 control-label">
                入库时间:
            </label>
            <div class="col-sm-7">
                <input data-ele="date" data-type="daterange" name="search[addTime]" class="form-control" placeholder="请选择" value="{if !empty($query.search.addTime)}{$query.search.addTime}{/if}" autocomplete="off"/>
            </div>

        </div>
        <div class="form-group col-lg-3 ui-select">
            <label class="col-sm-4 control-label">
                最近沟通时间:
            </label>
            <div class="col-sm-7">
                <input data-ele="date" data-type="daterange" name="search[lastCallTime]" class="form-control" placeholder="请选择" value="{if !empty($query.search.lastCallTime)}{$query.search.lastCallTime}{/if}" autocomplete="off"/>
            </div>

        </div>
        <div class="form-group col-lg-3 ui-select">
            <label for="exampleInputName2"  class="col-sm-4 control-label">委案到期时间:</label>
            <div class="col-sm-7">
                <input data-ele="date" data-type="daterange" name="search[entrustExpireTime]" class="form-control" placeholder="请选择" value="{if !empty($query.search.entrustExpireTime)}{$query.search.entrustExpireTime}{/if}" autocomplete="off"/>
            </div>
        </div>
        <div class="form-group col-lg-3 ui-select">
            <label for="exampleInputName2"  class="col-sm-4 control-label">分案时间:</label>
            <div class="col-sm-7">
                <input data-ele="date" data-type="daterange" name="search[allocateTime]" class="form-control" placeholder="请选择" value="{if !empty($query.search.allocateTime)}{$query.search.allocateTime}{/if}" autocomplete="off"/>
            </div>
        </div>

</div>
<div class="start-hide col-lg-12 form_row" data-isshow="{if $is_show == 1}true{else}false{/if}" {if $is_show == 1}style="padding:0px;"{else}style="padding:0px;display:none;"{/if}>
<div class="form-group col-lg-3 ui-select">
    <label for="exampleInputName2"  class="col-sm-4 control-label">移动复联状态:</label>
    <div class="col-sm-7">
        <select class="form-control selectpicker"  name="search[ydRepairStatus]" id="ydRepairStatus">
            <option class="u144_input_option" value="0">请选择</option>
            <option class="u144_input_option" {if !empty($query.search.ydRepairStatus) &&  1 == $query.search.ydRepairStatus}selected="selected"{/if} value="1">成功</option>
            <option class="u144_input_option" {if !empty($query.search.ydRepairStatus) &&  2 == $query.search.ydRepairStatus}selected="selected"{/if} value="2">失败</option>
        </select>
    </div>
</div>
<div class="form-group col-lg-3 ui-select">
    <label for="exampleInputName2"  class="col-sm-4 control-label">联通复联状态:</label>
    <div class="col-sm-7">
        <select class="form-control selectpicker"   name="search[ltRepairStatus]" id="ltRepairStatus">
            <option class="u144_input_option" value="0">请选择</option>
            <option class="u144_input_option" {if !empty($query.search.ltRepairStatus) &&  1 == $query.search.ltRepairStatus}selected="selected"{/if} value="1">成功</option>
            <option class="u144_input_option" {if !empty($query.search.ltRepairStatus) &&  2 == $query.search.ltRepairStatus}selected="selected"{/if} value="2">失败</option>
        </select>
    </div>
</div>

<div class="form-group col-lg-3 ui-select">
    <label for="exampleInputName2"  class="col-sm-4 control-label">用户标签:</label>
    <div class="col-sm-7">
        <select class="form-control selectpicker"   title="请选择" name="search[customLabel][]" multiple id="customLabel">
            {foreach from=$customLabel key=key  item=info}
            <option class="u144_input_option" {if !empty($query.search.customLabel) && in_array($key,$query.search.customLabel)}selected="selected"{/if} value="{$key}">{$info}</option>
            {/foreach}
        </select>
    </div>
</div>
<div class="form-group col-lg-3 ui-select">
    <label for="exampleInputName2"  class="col-sm-4 control-label">用户等级:</label>
    <div class="col-sm-7">
        <select class="form-control selectpicker"   title="请选择" name="search[customGrade][]" multiple id="customGrade">
            {foreach from=$customGrade key=key  item=info}
            <option class="u144_input_option" {if !empty($query.search.customGrade) &&  in_array($key,$query.search.customGrade)}selected="selected"{/if} value="{$key}">{$info}</option>
            {/foreach}
        </select>
    </div>
</div></div>
<div class="form_row col-lg-12">
    <div class="form-group col-lg-3 ui-select">
        <div class="col-lg-6">
            <button class="btn btn-primary col-lg-8 shousuoBtn"><span class="nav-icon glyphicon glyphicon-search" aria-hidden="true" style="margin-right: 2px"></span>查询</button>
        </div>
        <div class="col-lg-6">
            <a type="button" href="/casecenter/index" class="btn btn-default col-lg-8 "><span class="nav-icon glyphicon glyphicon-refresh" aria-hidden="true" style="margin-right: 2px"></span>重置</a>
        </div>
        <div class="col-lg-6">
            <a type="button" href="javascript:;" class="btn btn-default col-lg-8 show-more-btn">》更多</a>
        </div>
    </div>
    <div class="ui-select"></div>
    <div class="ui-select"></div>
    <div class="ui-select"></div>
</div>

</form>
<div style="width: 95%;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            overflow-x: scroll;">
    <table class="table table-striped table-bordered table-hover text-nowrap" id="tab">
        <thead>
        <tr>
            <th><input type="checkbox" class="checkall" style="vertical-align: text-bottom"></th>
            <th>导入批次</th>
            <th>案件号</th>
            <th>合同号</th>
            <th>调解部门</th>
            <th>资产方</th>
            <th>调解号</th>
            <th>调解员</th>
            <th>当事人</th>
            <th>系统状态</th>
            <th>案件状态</th>
            <th>调解状态</th>
            <th>还款状态</th>
            <th>导入批次</th>
            <th>案件标识号</th>
            <th>修复状态</th>
            <th>委案到期时间</th>
            <th>入库时间</th>
            <th  class="fix-ele">操作</th>
        </thead>
        <tbody>
        {if $arrList}
        {foreach from=$arrList key=key item=info}
        <tr data-caseid="{$info['id']}">
            <td> <input name="checkItem" class="j-check" type="checkbox" value="{$info.id}"></td>
            <td>{if $info['importRecordId']}{$info['importRecordId']}{/if}</td>
            <td>{$info['id']}</td>
            <td>{$info['contractNo']}</td>
            <td>{$mediationOrgan[$info['mediationOrganId']]['name']}</td>
            <td>{$assets[$info['assetsId']]['name']}</td>
            <td>{$info['mediationNum']}</td>
            <td>{$info['mediatorName']}</td>
            <td>{$info['litigantName']}</td>
            <td >{$sysStatusArr[$info['sysStatus']]}</td>
            <td>{$caseStatusArr[$info['caseStatus']]}</td>
            <td>{$mediateStatus[$info['mediateStatus']]}</td>
            <td>{$repayStatusArr[$info['repayStatus']]}</td>
            <td>{if $info['importRecordId']>0}{$info['importRecordId']}{/if}</td>
            <td>{$info['batshId']}</td>
            <td>
                {if $info['ydRepairStatus'] == 0}
                移动未修
                {elseif $info['ydRepairStatus'] == 1}
                移动成功
                {elseif $info['ydRepairStatus'] == 2}
                移动失败
                {/if}
                /
                {if $info['ltRepairStatus'] == 0}
                联通未修
                {elseif $info['ltRepairStatus'] == 1}
                联通成功
                {elseif $info['ltRepairStatus'] == 2}
                联通失败
                {/if}
            </td>
            <td>
                {if $info['entrustExpireTime']}
                {$info['entrustExpireTime']|date_format:"%Y-%m-%d %H:%M:%S"}
                {/if}
            </td>
            <td>
                {if $info['addTime']}
                {$info['addTime']|date_format:"%Y-%m-%d %H:%M:%S"}
                {/if}
            </td>
            <td class="text-nowrap fix-ele">
                <a href="/caseinfo/caseinfo?caseId={$info['id']}">详情</a >
                <a href="javascript:;" class='transfer_one' data-toggle="modal" data-target="#export_modal_transfer" data-id="{$info['id']}">转移案件</a >
                <a href="javascript:;" class='withdraw_one' data-toggle="modal" data-target="#export_modal_withdraw" data-id="{$info['id']}">撤案</a >
            </td>

        </tr>
        {/foreach}
        {/if}
        </tbody>
    </table>
</div>
<div class="mr-b20 col-lg-12 pad-no" style="float:none;">
    <input type="button" value="转移案件" id='transfer' data-toggle="modal" data-target="#export_modal_transfer" data-id='' class="btn btn-primary">
    <input type="button" value="撤案" id='withdraw' data-toggle="modal" data-target="#export_modal_withdraw" data-id='' class="btn btn-primary">
    <input type="button" value="更新委案到期时间" id='entrustExpireTime' data-toggle="modal" data-target="#export_modal_entrustExpireTime" data-id='' class="btn  btn-primary">
    <input type="button" value="导出调解记录" id='exportMediateRecord' data-toggle="modal" data-target="#export_modal_exportMediateRecord" data-id='' class="btn  btn-primary">
    <input type="button" value="导出调解录音" id='exportFileRecord' data-toggle="modal" data-target="#export_modal_exportFileRecord" data-id='' class="btn  btn-primary">
    <input type="button" value="导出通话记录" id='exportCallRecord' data-toggle="modal" data-target="#export_modal_exportCallRecord" data-id='' class="btn  btn-primary">
    <input type="button" value="导出短信记录" id='exportSmsRecord' data-toggle="modal" data-target="#export_modal_exportSmsRecord" data-id='' class="btn  btn-primary">
</div>
<div class="clearfix pad-no text-nowrap" style="margin-top: 20px;">
    {include file="base/pagenav.html"  action="/casecenter/index" pagenum=$curPageNum inline}
    <select class="form-control" id="paglimit" style="float:right;margin:0 10px;width: auto;margin-top: -5px;">
        <option value="limit=10" {if $query.limit==10}selected="selected"{/if}>10条/页</option>
        <option value="limit=20" {if $query.limit==20}selected="selected"{/if}>20条/页</option>
        <option value="limit=50" {if $query.limit==50}selected="selected"{/if}>50条/页</option>
        <option value="limit=100" {if $query.limit==100}selected="selected"{/if}>100条/页</option>
        <option value="limit=500" {if $query.limit==500}selected="selected"{/if}>500条/页</option>
        <option value="limit=1000" {if $query.limit==1000}selected="selected"{/if}>1000条/页</option>
        <option value="limit=2000" {if $query.limit==2000}selected="selected"{/if}>2000条/页</option>
    </select>
    <span style="float:right;">共 {$totalnum} 条</span>
</div>
</div>



<div class="modal fade" id="export_modal_withdraw" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="exampleModalLabel">撤案</h4>
            </div>
            <div class="modal-body">
                <form id="withdraw_form">
                    <p> 即将对 <span style="color: green" id="chean_num"></span> 件撤案 <span style="color: red">撤案</span> ,请确认是否继续!<p >
                    <input type="hidden" value="" id="withdraw_case_ids" name="withdraw_case_ids">
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-default" id="fpclosebtn" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary distribution">确定</button>
            </div>


        </div>
    </div>
</div>


<div class="modal fade" id="export_modal_transfer" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="exampleModalLabel">转移案件</h4>
            </div>
            <div class="modal-body">
                <form id="transfer_form">
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2"  class="col-sm-4 control-label">调解员:</label>
                        <div class="col-sm-9">
                            <select class="form-control" id="mediators_id" name="mediators_id">
                                <option value="" >——请选择——</option>
                                {foreach from=$mediator item=info}
                                <option class="u144_input_option" value="{$info.id}">{$info.name}</option>
                                {/foreach}
                            </select>
                        </div>
                        <input type="hidden" value="" id="transfer_case_ids" name="transfer_case_ids">

                    </div>
                    </br>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-default" id="fpclosebtn" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary distribution_transfer">确定</button>
            </div>


        </div>
    </div>
</div>
<div class="modal fade" id="export_modal_exportFileRecord" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" >导出调解录音</h4>
            </div>
            <div class="modal-body">
                <form id="exportFileRecord_form">
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2"  class="col-sm-4 control-label">录音命名格式:</label>
                        <div class="col-sm-12">
                            <select class="form-control"  name="fileType">
                                <option value="" >——请选择——</option>
                                <option class="u144_input_option" value="litigantName_contractNo_id">名字_合同号_录音id</option>
                                <option class="u144_input_option" value="litigantName_batshId_id">名字_案件标识号_录音id</option>
                                <option class="u144_input_option" value="litigantName_callPhone_id">名字_手机号_录音id</option>
                                <option class="u144_input_option" value="contractNo_callPhone_id">合同号_手机号_录音id</option>
                                <option class="u144_input_option" value="litigantName_contractNo_callPhone_id">名字_合同号_手机号_录音id</option>
                                <option class="u144_input_option" value="callTime_callPhone_callType">时间_手机号_呼叫类型</option>
                                <option class="u144_input_option" value="callPhone_callTimeDay_callTimeHour_callEndTimeHour">手机号_日期_接通时间_挂断时间</option>
                            </select>
                        </div>

                        <input type="hidden" value="" id="exportFile_case_ids" name="exportFile_case_ids">
                    </div>
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2" class="col-sm-4 control-label">沟通时间段:</label>
                        <div class="col-sm-12">
                            <input data-ele="date" data-type="daterange" name="callTime" class="form-control" placeholder="若不填，则全部导出~" value="" autocomplete="off"/>
                        </div>
                    </div>
                    </br>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-default" id="fpclosebtn" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary distribution_exportFileRecord">确定</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="export_modal_exportCallRecord" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" >导出通话记录</h4>
            </div>
            <div class="modal-body">
                <form id="exportCall_form">
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2"  class="col-sm-4 control-label">自定义文件名:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control noempty col-sm-4"  value="" name="fileType" id="fileType" placeholder="若不填写，系统自动生成~">
                        </div>
                        <input type="hidden" value="" id="exportCall_case_ids" name="exportCall_case_ids">
                    </div>
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2" class="col-sm-4 control-label">沟通时间段:</label>
                        <div class="col-sm-9">
                            <input data-ele="date" data-type="daterange" name="callTime" class="form-control" placeholder="若不填，则全部导出~" value="" autocomplete="off"/>
                        </div>
                    </div>
                    </br>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-default" id="fpclosebtn" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary distribution_exportCall">确定</button>
            </div>


        </div>
    </div>
</div>
<div class="modal fade" id="export_modal_exportMediateRecord" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" >导出调解记录</h4>
            </div>
            <div class="modal-body">
                <form id="exportMediate_form">
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2"  class="col-sm-4 control-label">自定义文件名:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control noempty col-sm-4"  value="" name="fileType" id="fileType" placeholder="若不填写，系统自动生成~">
                        </div>
                        <input type="hidden" value="" id="export_case_ids" name="export_case_ids">
                    </div>
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2" class="col-sm-4 control-label">沟通时间段:</label>
                        <div class="col-sm-9">
                            <input data-ele="date" data-type="daterange" name="callTime" class="form-control" placeholder="若不填，则全部导出~" value="" autocomplete="off"/>
                        </div>
                    </div>
                    </br>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-default" id="fpclosebtn" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary distribution_exportMediate">确定</button>
            </div>


        </div>
    </div>
</div>
<div class="modal fade" id="export_modal_exportSmsRecord" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" >导出短信记录</h4>
            </div>
            <div class="modal-body">
                <form id="exportSms_form">
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2"  class="col-sm-4 control-label">自定义文件名:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control noempty col-sm-4"  value="" name="fileType" id="fileType" placeholder="若不填写，系统自动生成~">
                        </div>
                        <input type="hidden" value="" id="exportSms_case_ids" name="export_case_ids">
                    </div>
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2" class="col-sm-4 control-label">发送时间段:</label>
                        <div class="col-sm-9">
                            <input data-ele="date" data-type="daterange" name="sendTime" class="form-control" placeholder="若不填，则全部导出~" value="" autocomplete="off"/>
                        </div>
                    </div>
                    </br>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-default" id="fpclosebtn" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary distribution_exportSms">确定</button>
            </div>


        </div>
    </div>
</div>


<div class="modal fade" id="export_modal_entrustExpireTime" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="exampleModalLabel">更新委案到期时间</h4>
            </div>
            <div class="modal-body">
                <form id="entrustExpireTime_form">
                    <div class="form_dialog form-group col-lg-10 ui-select">
                        <label for="exampleInputName2"  class="col-sm-3 control-label">延期时间:</label>
                        <div class="col-sm-9">
                            <input type="date" class="form-control"  id="delayTime"  name="delayTime" placeholder="延期时间">

                        </div>
                    </div>

                    <input type="hidden" value="" id="entrustExpireTime_case_ids" name="entrustExpireTime_case_ids">

                </form>

            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-default" id="fpclosebtn" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary distribution_entrustExpireTime">确定</button>
            </div>


        </div>
    </div>
</div>


{/block}
{block name="page_scripts"}
<script type="text/javascript" src="/js/module/date.js"></script>
<script type="text/javascript" src="/js/mediation/casecenter/index.min.js" init="mediation/casecenter/index"></script>
<script type="text/javascript">

    //撤案
    $(".withdraw_one").on("click",function(){
        var ids=$(this).attr('data-id');
        $("#withdraw_case_ids").val(ids);
        $("#chean_num").text(1);

        console.log(arrbtn);
        $("#export_modal_withdraw").show();
    });

    $("#withdraw").on("click",function(){
        var arrbtn = [];
        $(".j-check:checked").each(function (index, ele) {
            //遍历所有复选框，然后取值进行 !非操作
            if ($(this).prop("checked")) {
                arrbtn.push($(this).val());
            }
        })
        if(arrbtn.length==0){
            toastr.error('请选择案件');
            return false;
        }
        $("#chean_num").text(arrbtn.length);
        var ids=arrbtn.toString();
        $("#withdraw_case_ids").val(ids);
        console.log(arrbtn);
        $("#export_modal_withdraw").show();
    });

    //转移案件

    $(".transfer_one").on("click",function(){
        var ids=$(this).attr('data-id');
        $("#transfer_case_ids").val(ids);
        $("#export_modal_transfer").show();
    });
    $("#transfer").on("click",function(){
        var arrbtn = [];
        $(".j-check:checked").each(function (index, ele) {
            //遍历所有复选框，然后取值进行 !非操作
            if ($(this).prop("checked")) {
                arrbtn.push($(this).val());
            }
        })
        if(arrbtn.length==0){
            toastr.error('请选择案件');
            return false;
        }
        var ids=arrbtn.toString();
        $("#transfer_case_ids").val(ids);
        console.log(arrbtn);
        $("#export_modal_transfer").show();
    });
    //导出调解记录
    $("#exportMediateRecord").on("click",function(){
        var arrbtn = [];
        $(".j-check:checked").each(function (index, ele) {
            //遍历所有复选框，然后取值进行 !非操作
            if ($(this).prop("checked")) {
                arrbtn.push($(this).val());
            }
        })
        if(arrbtn.length==0){
            toastr.error('请选择案件');
            return false;
        }
        var ids=arrbtn.toString();
        $("#export_case_ids").val(ids);
        console.log(arrbtn);
        $("#export_modal_exportMediateRecord").show();
    });
    //导出调解记录
    $("#exportSmsRecord").on("click",function(){
        var arrbtn = [];
        $(".j-check:checked").each(function (index, ele) {
            //遍历所有复选框，然后取值进行 !非操作
            if ($(this).prop("checked")) {
                arrbtn.push($(this).val());
            }
        })
        if(arrbtn.length==0){
            toastr.error('请选择案件');
            return false;
        }
        var ids=arrbtn.toString();
        $("#exportSms_case_ids").val(ids);
        console.log(arrbtn);
        $("#export_modal_exportSmsRecord").show();
    });
    //导出调解记录
    $("#exportFileRecord").on("click",function(){
        var arrbtn = [];
        $(".j-check:checked").each(function (index, ele) {
            //遍历所有复选框，然后取值进行 !非操作
            if ($(this).prop("checked")) {
                arrbtn.push($(this).val());
            }
        })
        if(arrbtn.length==0){
            toastr.error('请选择案件');
            return false;
        }
        var ids=arrbtn.toString();
        $("#exportFile_case_ids").val(ids);
        console.log(arrbtn);
        $("#export_modal_exportFileRecord").show();
    });
    //导出调解记录
    $("#exportCallRecord").on("click",function(){
        var arrbtn = [];
        $(".j-check:checked").each(function (index, ele) {
            //遍历所有复选框，然后取值进行 !非操作
            if ($(this).prop("checked")) {
                arrbtn.push($(this).val());
            }
        })
        if(arrbtn.length==0){
            toastr.error('请选择案件');
            return false;
        }
        var ids=arrbtn.toString();
        $("#exportCall_case_ids").val(ids);
        console.log(arrbtn);
        $("#export_modal_exportCallRecord").show();
    });
    //转移案件
    $(".entrustExpireTime_one").on("click",function(){

        var ids=$(this).attr('data-id');

        $("#entrustExpireTime_case_ids").val(ids);

        $("#export_modal_entrustExpireTime").show();
    });
    $("#entrustExpireTime").on("click",function(){
        var arrbtn = [];
        $(".j-check:checked").each(function (index, ele) {
            //遍历所有复选框，然后取值进行 !非操作
            if ($(this).prop("checked")) {
                arrbtn.push($(this).val());
            }
        })
        if(arrbtn.length==0){
            toastr.error('请选择案件');
            return false;
        }
        var ids=arrbtn.toString();
        $("#entrustExpireTime_case_ids").val(ids);

        $("#export_modal_entrustExpireTime").show();
    });
    function GetQueryString(name){
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
    $('body').on('change','#paglimit', function(){
        console.log()
        var mediationOrganId = GetQueryString('mediationOrganId');
        var paglimit = GetQueryString('limit');
        var source = GetQueryString('source');
        var val =  $(this).val();
        if(!mediationOrganId){
            if(!paglimit && source){
                window.location = window.location.href+'&'+val;
            }else if(!paglimit){
                window.location = window.location.href+'?'+val;
            }else{
                window.location = window.location.href.replace('limit='+paglimit,val);
            }
        }else{
            if(!paglimit){
                window.location = window.location.href+'&'+val;
            } else{
                window.location = window.location.href.replace('limit='+paglimit,val);
            }
        }
    })

</script>
{/block}
